package com.yonyou.pmclouds.project.entity;

import com.yonyou.pmclouds.basecom.entity.SuperVO;
import com.yonyou.pmclouds.basecom.util.CommonFieldConst;
import com.yonyou.pmclouds.basecom.util.CommonProgramConsts;
import com.yonyou.pmclouds.procedure.entity.ProcedureRefVO;
import com.yonyou.pmclouds.projectstatus.entity.ProjectStatusVO;
import com.yonyou.pmclouds.projecttype.entity.ProjectTypeVO;
import com.yonyou.pmclouds.team.entity.TeamEnterpriseViewVO;
import lombok.Data;

import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.util.Date;

@Data
public class ProjectViewVO extends SuperVO {

    @NotNull(groups = ProjectViewVO.UpdateValid.class)
    @Size(min = CommonProgramConsts.UUID_STRING_LENGTH,
            max = CommonProgramConsts.UUID_STRING_LENGTH, groups = ProjectViewVO.UpdateValid.class)
    private String pkProject;
    private String pkTenant;
    @NotNull(groups = ProjectViewVO.InsertValid.class)
    @Size(max = 20, groups = ProjectViewVO.InsertValid.class)
    private String scode;
    @NotNull(groups = ProjectViewVO.InsertValid.class)
    @Size(max = 300, groups = ProjectViewVO.InsertValid.class)
    private String sname;
    /**
     * 项目经理
     */
    private String manager;

    private String managerName;
    /**
     * 立项日期
     */
    @NotNull(groups = ProjectViewVO.InsertValid.class)
    private Date approvalDate;
    /**
     * 验收日期（初始需求为"结束日期"）
     */
    private Date endDate;
    /**
     * 描述
     */
    @Size(max = 300)
    private String description;
    /**
     * 项目状态：进行中：0；已结束:1
     *
     * @see ProjectConst
     */
    private byte projectState;
    private String creator;
    @Transient
    private String creatorName;
    private Date creationtime;
    private String modifier;
    private Date modifytime;

    /**  20180509新增字段 **/
    /**
     * 组织字段：目前只有NC集成时，推送生成
     */
    private String pkOrg;
    /**
     * 档案来源：
     *      友工程默认为空
     *      NC记为NC
     *
     */
    private String srcType;
    /**
     * 记录来源主键
     */
    private String pkSrc;

    private String managerMobile;

    private String creatorMobile;
    // 项目经理所属企业
    private String managerEnt;

    private String orgName;

    public interface UpdateValid {
    }

    public interface InsertValid {
    }

    //重点项目标识
    private Boolean iskey;

    private TeamEnterpriseViewVO[] teamEnterpriseViewVOs;

    private String pkProjectType;

    private String projectTypeName;

    private String pkProjectStatus;

    private String projectStatusName;

    private ProjectTypeVO projectTypeCloudVO;

    private ProjectStatusVO projectStateCloudVO;
    /**
     * 项目地址
     */
    private String address;
    /**
     * 经度
     */
    private BigDecimal longitude;
    /**
     * 纬度
     */
    private BigDecimal latitude;

    //新添字段
    @Transient
    private String[] procedures;//关联工序
    @Transient
    private ProcedureRefVO[] procedure;//展示工序
    //新增转化字段
    public static String[] transFields = new String[] { ProjectVO.PK_PROJECT,
            ProjectVO.MANAGER, ProjectVO.APPROVAL_DATE, ProjectVO.END_DATE, ProjectVO.DESCRIPTION,
            ProjectVO.PROJECT_STATE,ProjectVO.SNAME , ProjectVO.SCODE, CommonFieldConst.PK_TENANT, ProjectVO.ISKEY,
            CommonFieldConst.CHANGE_FLAG,ProjectVO.PK_ORG,ProjectVO.SRCTYPE,ProjectVO.PK_SRC,ProjectVO.MANAGERMOBILE,
            ProjectVO.CREATOR,ProjectVO.CREATORMOBILE, CommonFieldConst.CREATIONTIME,
            ProjectVO.PROJECT_TYPE_CLOUD_VO, ProjectVO.PROJECT_STATE_CLOUD_VO, ProjectVO.PK_PROJECT_STATUS,
            ProjectVO.PK_PROJECT_TYPE, ProjectVO.PROCEDURES, ProjectVO.ADDRESS, ProjectVO.LONGITUDE, ProjectVO.LATITUDE};

}
